"""
有三种数值类型，分别是
1. 整形int (2,3,4,5)，整形还包括特殊类型布尔类型，(True 和 False，分别是 1 和 0)

2. 浮点数float (2.23, 2.3)

3. 复数complex (4 - 7i, 3 + 6i)
"""

def testIntNumber():
    i_a = 2
    sign_a = -23
    max_I = 35656222554887711

    print("isinstance(i_a, int) is {}".format(isinstance(i_a, int)))
    print("isinstance(sign_a, int) is {}".format(isinstance(sign_a, int)))
    print("isinstance(max_I, int) is {}".format(isinstance(max_I, int)))

def testBoolNumber():
    true, false = True, False

    print("isinstance(true, bool) is {}".format(isinstance(true, bool)))
    print("isinstance(false, bool) is {}".format(isinstance(false, bool)))

    # 将bool转化为字符串
    print("str(true) is {}".format(str(true)))


def testFloatNumber():
    f_a = 1.897

    # 声明浮点数的另外一种形式
    f_b = float(9)
    sign_fa = -1.243

    print("isinstance(f_a, float) is {}".format(isinstance(f_a, float)))
    print("isinstance(f_b, float) is {}".format(isinstance(f_b, float)))
    print("isinstance(sign_fa, float) is {}".format(isinstance(sign_fa, float)))

    # 浮点数的科学计数法 e
    fe_a = 35e3
    fe_max = 12E4

    print("fe_a(35e3) is {}".format(fe_a))
    print("fe_max(12E4) is {}".format(fe_max))

    print("isinstance(-12.34e10, float) is {}".format(isinstance(-12.34e10, float)))

def testComplex():
    complex_a = 3 -4j
    complex_b = 4 + 3j

    print("isinstance(complex_a, complex) is {}".format(isinstance(complex_a, complex)))
    print("isinstance(complex_b, complex) is {}".format(isinstance(complex_b, complex)))
    print("complex_a * complex_b = {}".format(complex_a * complex_b))

testIntNumber()
testBoolNumber()
testFloatNumber()
testComplex()